<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>列表页</title>
</head>
<body>

<a th:href="@{/toUserAddPage}">添加用户</a>
<!--    这里就可以展示数据了 -->

<table cellpadding="0" cellspacing="0" border="1" style="width: 700px;text-align: center">

    <tr>
        <th>用户id</th>
        <th>用户名</th>
        <th>密码</th>
        <th>操作</th>
    </tr>
    <tr th:each="user:${userList}">
        <td th:text="${user.userId}"></td>
        <td th:text="${user.username}"></td>
        <td th:text="${user.password}"></td>
        <td>
            <a th:href="@{/findUserById(userId=${user.userId})}">编辑</a>&nbsp;&nbsp; <a th:href="@{/deleteById(userId=${user.userId})}">删除</a>
        </td>
    </tr>
</table>

</body>
</html>